<template>
  <div>
    <el-descriptions style="width:50%" class="margin-top" title="人员详情" :column="3" :size="'medium'" border>
      <template slot="extra">
        <el-button v-if="false" type="primary" @click="handleEditPerson">编辑</el-button>
      </template>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-user"></i>
          用户名
        </template>
        {{ $route.query.name}}
      </el-descriptions-item>
      <el-descriptions-item v-if="false">
        <template slot="label">
          <i class="el-icon-mobile-phone"></i>
          手机号
        </template>
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import { editEventIdentity } from "@/api/community/person";

export default {
  props:{
    personDetails:{
      type:Object,
      default:() => ({})
    }
  },
  data() {
    return {
      hiddenMap: {
        name: false,
        id: false,
        phone: false,
      },
    };
  },
  methods: {
    //隐藏部分姓名、手机号、身份证号
    hiddenText(str, frontLen, endLen, type) {
      // frontLen: 前面需要保留几位    endLen: 后面需要保留几位
      // console.log(str,'utils')
      if (type !== "name") {
        if (!str || str.length == 0) return "--";
        let len = str.length - frontLen - endLen;
        let xing = "";
        for (let i = 0; i < len; i++) {
          xing += "*";
        }
        return (
          str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
        );
      }
      return str ?? "--";
    },
    toggleHidden(type) {
      this.hiddenMap[type] = !this.hiddenMap[type];
    },
    handleEditPerson () {

    }
  },
  created() {},
};
</script>

<style lang="scss" scoped>
.copy {
  font-size: 14px;
  color: #3571ff;

  &:hover {
    cursor: pointer;
  }
}
.icon {
  margin-left: 5px;
  height: 20px;
  width: 20px;
  cursor: pointer;
}
</style>
